package com.xcc.daggerdemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;

import java.util.List;

import javax.inject.Inject;

public class MainActivity extends AppCompatActivity implements MainContract.View {
    @Inject
    public MainPresenter mainPresenter;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        DaggerMainComponent.builder()
                .mainModule(new MainModule(this))
                .build()
                .inject(this);

        // 调用Presenter方法加载数据
        mainPresenter.loadData();
    }

    @Override
    public void updateUI() {
        Toast.makeText(this, "啦啦啦", Toast.LENGTH_LONG).show();
    }
}
